<template>
    <div>
        TEST
    </div>
    <div>
        <input type="text" placeholder="账号" v-model="user.account"><br>
        <input type="text" placeholder="密码" v-model="user.password"><br>
        <input type="text" placeholder="邮箱" v-model="user.email">
    </div>
    <div>
        <button @click="register">注册</button>
    </div>
</template>

<script setup>
import axios from 'axios';
import { reactive } from 'vue';

const user = reactive({
    account: "",
    password: "",
    email: ""
})


async function register() {
    let res_msg = await axios.post(
        "/register/",
        {
            user_account: user.account,
            user_password: user.password,
            user_email: user.email
        },
    )

    if (res_msg.data.code === 200) {
        console.log(res_msg.data.msg);
    } else {
        console.log("申请失败 请重试");
    }
}

</script>

<style lang="scss" scoped>

</style>